import sys

from PySide6.QtGui import QAction, QIcon
from PySide6.QtWidgets import (QApplication, QColorDialog, QMenu, QSystemTrayIcon)

app = QApplication(sys.argv)
app.setQuitOnLastWindowClosed(False)

icon = QIcon("icon.png")

tray = QSystemTrayIcon()
tray.setIcon(icon)
tray.setVisible(True)

menu = QMenu()
action = QAction("A menu item")
menu.addAction(action)

quit = QAction("Quit")
quit.triggered.connect(app.quit)
menu.addAction(quit)

tray.setContextMenu(menu)

app.exec()


